// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

LL bin(LL a, LL b, LL p) {
	LL res = 1;
	for (a%=p; b; b>>=1, a=a*a%p)
		if (b & 1)
			res = res * a % p;
	return res;
}

int t, n;

const int N = 1e5+50;

LL a[N];

LL b[N];

int maxbit(LL x) {
	if (x == 0)
		return -1;
	int cnt = 0;
	LL y = 0;
	while (y < x) {
		++cnt;
		y = y * 2 + 1;
	}
	return cnt;
}
// 1 4-7 16-31 64-127 ...

// 3 
int main(int argc, char const *argv[]) {
    scanf("%d", &t);
    for (int kk=0; kk<t; ++kk) {
    	scanf("%d", &n);
    	for (int i=1; i<=n; ++i) {
    		scanf("%lld", &a[i]);
    	}
    	b[1] = a[1];
    	for (int i=2; i<=n; ++i)
    		b[i] = max(a[i], b[i-1]);
    	// for (int i=2; i<=n; ++i) {
    	// 	b[i] = max(0, a[i-1]-a[i]);
    	// 	a[i] = max(a[i], a[i-1]);
    	// }
    	int ans = 0;
    	for (int i=2; i<=n; ++i) {
    		ans = max(ans, maxbit(b[i]-a[i]));
    	}
    	printf("%d\n", ans);
    }

    // LL n;
    // cin >> n;
    // LL m = (n-1)/3+1;

    return 0;
}